package cn.lixunims;

import cn.lixunims.auth.core.util.StpLoginUserUtil;
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;


/**
 * 积木报表配置
 * @author YouDong
 * @date  2024-09-16
 */
@Configuration
@ComponentScan(basePackages = {"org.jeecg.modules.jmreport"})
public class JmReportTokenService implements JmReportTokenServiceI {



    @Override
    public String getUsername(String s) {
        return StpLoginUserUtil.getLoginUser().getName();
    }

    @Override
    public String[] getRoles(String s) {
        return new String[0];
    }

    @Override
    public Boolean verifyToken(String s) {
        try {
            StpLoginUserUtil.getLoginUser();
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}
